import java.util.Random;
import java.util.Scanner;

//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
public class Main {
    public static void fun(int a) {
        if(a == 0) {
            return;
        }
        fun(a-1);
        System.out.println(a);
    }

    public static void main(String[] args) {
        fun(6);
    }
    public static void main13(String[] args) {
        Scanner scanner = new Scanner(System.in);

        Random random = new Random();
        int randNum = random.nextInt(100);
        while (true) {
            System.out.println("请输入你要猜的数字：");
            int num = scanner.nextInt();
            if(num < randNum) {
                System.out.println("猜小了");
            }else if(num > randNum) {
                System.out.println("猜大了");

            }else {
                System.out.println("猜对了");
                break;
            }
        }
    }

    public static void main12(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while(scanner.hasNextInt()) {
            int x = scanner.nextInt();
            System.out.println(x);
        }

        scanner.close();
    }
    public static void main11(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入你的姓名:");
        String name = scanner.nextLine(); // 读取一行
        System.out.println(name);
        String name2 = scanner.next();  // 遇到空格就停止
        System.out.println(name2);

        scanner.close();
    }
    public static void main10(String[] args) {
        int i = 1;
        while(i <= 10) {
            if(i == 3) {
                break;
            }
            System.out.println(i++);
        }
    }

    public static void main9(String[] args) {
        Scanner scanner = new Scanner(System.in);
//        int x = scanner.nextInt();
        int x = 100;
        int k = 0;
        while(k <= x) {
            if(k == 0 || k == 1) {
                System.out.println(k+"不是素数");
                k++;
                continue;
            }
            int i = 2;
            while(i <= Math.sqrt(k)) {
                if(k % i == 0) {
                    System.out.println(k+"不是素数");
                    k++;
                    continue;
                }
                i++;
            }
            System.out.println(k+"是素数");
            k++;
        }
    }
    public static void main8(String[] args) {
        System.out.println("\\\"hello\\\"");

        short a = 128;
        byte b = (byte) a;
        System.out.println(a);
        System.out.println(b);
    }

    public static void main7(String[] args) {
        // 关于小数的求余数，就看第一个是正数还是负值
        // 1 1 -1 -1
        System.out.println(7 % 3);
        System.out.println(7 % -3);
        System.out.println(-7 % 3);
        System.out.println(-7 % -3);

        long b = 10L;
        int i = 3;
        i += b;
        System.out.println(i);
    }
    public static void main6(String[] args) {
//        int a = 10;
//        int b = 20;
//        System.out.println("a+b ==" +a+b);
//        System.out.println("a+b ==" + (a+b));

        String str = "123";
        int val = Integer.parseInt(str);
        System.out.println(val+1);

        int a = 123;
        String str2 = String.valueOf(a);
        System.out.println(str2);
    }

    public static void main5(String[] args) {
        byte b1 = 10;
        byte b2 = 20;
        // 这里如果b1 + b2 小于4字节，那么会提升为4字节
        int b3 = b1 + b2;
        System.out.println(b3);

        short s1 = 10;
        short s2 = 20;
        int s3 = s1 + s2;
        System.out.println(s3);
    }

    public static void main4(String[] args) {
        // char在java中是2个字节
        char ch = '牛';
        System.out.println(ch);

        Character a = 'b';
    }
    public static void main3(String[] args) {
        // float 4字节，要加f，如果不加f，就是8字节，不能赋给4字节的float
        float f = 12.5f;
        System.out.println(f);

        double d = 12.5;
        System.out.println(d);

    }

    public static void main2(String[] args) {
        byte a = 10;
        System.out.println(a);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }

    public static void main1(String[] args) {
        int a = 10;
        System.out.println(a);

        /*
        java中不允许使用未初始化的局部变量
         */
        int b = 20;
        System.out.println(b);
    }
}